#include<iostream>
#include<vector>
class Solution {
public:
    int min(int x, int y)
    {
        if (x < y)
            return x;
        return y;
    }
    int maxArea(vector<int>& height) {
        int n = height.size(); int left = 0, right = n - 1;
        int max = 0, v = 0;;
        while (left < right)
        {
            v = (right - left) * min(height[left], height[right]);
            if (height[left] >= height[right]) right--;
            else left++;
            if (max < v) max = v;
        }
        return v;
    }
};

int main()
{


	return 0;
}